home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / datlnk.zip / DATEOBJ.PAS < prev   
Pascal/Delphi Source File  |  1993-01-04  |  1KB  |  64 lines

  1. {$I DMINUS.INC}
  2. {$O+} {so we can overlay this unit if we decide to}
  3.  
  4. UNIT DateObj;
  5.  
  6.    {Linked list holds dates in ascending order.}
  7.  
  8.  
  9. INTERFACE {section}
  10.  
  11. USES
  12.    TpDate,
  13.    Objects;
  14.  
  15.  
  16. TYPE
  17.    DateObjectPtr = ^DateObject;
  18.    DateObject
  19.     = OBJECT(Node)
  20.       TheDate : Date;
  21.  
  22.       CONSTRUCTOR Init(NewDate : Date);
  23.       FUNCTION    GetDate : Date;
  24.       FUNCTION    SelfPtr : DateObjectPtr
  25.       END;
  26.  
  27.  
  28. IMPLEMENTATION {section}
  29.  
  30.  
  31. {============================================================================}
  32. CONSTRUCTOR DateObject.Init(NewDate : Date);
  33.  
  34.    {Initialize the DateObject.}
  35.  
  36. BEGIN {DateObject.Init}
  37. TheDate := NewDate;
  38.  
  39. END; {DateObject.Init}
  40. {============================================================================}
  41.  
  42. {============================================================================}
  43. FUNCTION    DateObject.GetDate : Date;
  44.  
  45.    {Return the Date from the object.}
  46.  
  47. BEGIN {GetDate}
  48. GetDate := TheDate
  49. END; {GetDate}
  50. {============================================================================}
  51.  
  52. {============================================================================}
  53. FUNCTION    DateObject.SelfPtr : DateObjectPtr;
  54.  
  55.    {Returns a pointer to this object.}
  56.  
  57. BEGIN {SelfPtr}
  58. SelfPtr := @Self
  59. END; {SelfPtr}
  60. {============================================================================}
  61.  
  62.  
  63. END. {DateObj}
  64.